import {Switch, Route} from 'react-router-dom'
import { route } from './router';
import Header from './compoment/header'
import Footer from './compoment/footer'
import {Layout} from 'antd'
function App() {
  return (
    <div >
      <Layout className='page'>
      <Header />
      <Layout.Content>
        <div className='wrap'>
       <Switch>
         {route.map((item,index)=>{
           return (<Route 
                  key={index}
                  path={item.path}
                  exact={item.exact}
                  render={(props)=>{
                    props.username='kkb'
                    return item.render(props)
                  }} />)
         })}
       </Switch>
       </div>
       </Layout.Content>
       <Footer/>
       </Layout>
    </div>
  );
}

export default App;
